import {request} from '@/utils/request'  

// 酒店推荐列表查询
export const hotelRecommd = <T>(data?:T) => {  
    return request({
        url:"merchant/hotel/client/recommend",
        method:"POST",
        data:data
    });
};

// 酒店查询
export const gegetByPage = <T>(data?:T) => {  
	// console.log(data);
    return request({
        url:"merchant/hotel/client/getByPage?name="+ data.name + '&lnt='+ data.lnt + '&district='+ data.district + '&lat='+ data.lat + '&beginDate='+ data.beginDate + '&endDate='+ data.endDate,
        method:"GET"
    });
};

// 酒店详情查询
export const hotelDetail = <T>(data?:T) => {   
	// const data = {id:id}
    return request({
        url:"merchant/hotel/client/detail",
        method:"POST", 
		headers: { 
		    'Content-Type': 'application/json'
		 },
		data
    });
};

// 酒店房型详情查询
export const roomDetail = <T>(id?:T) => {   
	// const data = {id:id}
    return request({
        url:"merchant/hotel/client/detailHouse?id="+id,
        method:"GET", 
		headers: { 
		    'Content-Type': 'application/json'
		 }
    });
};
// 获取酒店价格
export const hotelPrice = <T>(data?:T) => {  
    return request({
        url:"merchant/hotel/client/countAmount?productId="+ data.id + '&beginDate='+ data.checkInTime + '&endDate='+ data.checkOutTime,
        method:"GET"
    });
};

// 订单提交
export const commitOrder = <T>(data?:T) => {  
    return request({
        url:"order/client/house/add",
        method:"POST",
        data
    });
};
 

// 支付
export const toPay = <T>(data?:T) => {
    return request({
        url:"order/pay/wx/toPay",
        method:"POST",
        data,
    });
};